package com.harusoft.bluetooth;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class GridAdapter extends BaseAdapter {

	public ArrayList<String> number;
	private LayoutInflater inflater;
	
	public GridAdapter(Context context){
		this.number=new ArrayList<String>();
		inflater=LayoutInflater.from(context);
	}
	
	@Override
	public int getCount() {
		return number.size();
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {

		if(convertView==null) convertView=inflater.inflate(R.layout.grid_item, null);
		TextView text=(TextView)convertView.findViewById(R.id.item_text);
		text.setText(number.get(position));
		
		return convertView;
	}

}
